package play;

import org.antlr.v4.runtime.ParserRuleContext;

public class Variable extends Symbol {

    // 变量类型
    protected Type type = null;

    // 默认值
    protected Object defaultValue = null;

    // 是否允许多次重复
    protected Integer multiplicity = 1;

    protected Variable(String name, Scope enclosingScope, ParserRuleContext ctx) {
        this.name = name;
        this.enclosingScope = enclosingScope;
        this.ctx = ctx;
    }

    public boolean isClassMember() {
        return enclosingScope instanceof Class;
    }
}
